package com.liupei.controller;

import com.liupei.entity.Sys;
import com.liupei.service.SysService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/sys")
public class SysController {

    @Autowired
    private SysService sysService;

    @RequestMapping(value = "/add", method = RequestMethod.POST)
    public Map<String,String> add(){

        Map<String,String> map = new HashMap<String,String>();
        Sys sys = new Sys();

        sys.setSysName("张三");

        sysService.addSys(sys);
        map.put("sysId",sys.getId()+"");
        return map;
    }
}
